The existing Ethernet is developing into a direction of multiple service carriers, and as some services require higher network reliability and better real-time network performance etc., a redundant networking manner has been widely applied in the Ethernet to improve the network reliability. In the redundant networking structure of the Ethernet, it is usually required that the speed of a protection switching is fast enough, and the time length of the protection switching should be within 50 ms. Currently, technologies relating to rapid protection switching comprise the RFC3619 standard put forward by the Internet Engineering Task Force (IETF) and the G.8032 standard put forward by the International Telecommunication Union (ITU-T) etc.
In the G.8032 standard put forward by the ITU-T, automatic protection switching protocol and mechanism are defined for an Ethernet layer of a ring topological Ethernet. The automatic protection switching method is applicable to the ring topological Ethernet and the implementation process of the method is as follows. In the ring topological Ethernet, one link is selected as a ring protection link, when there is no fault in all links of the Ethernet ring network, a port connected with the ring protection link is blocked by at least one of two adjacent nodes of the ring protection link, so as to prevent the protected data from passing through the ring protection link. In this way, there is a unique communication path between any two nodes on the Ethernet ring network, therefore closed loop of the communication path will not occur in the Ethernet ring network, thus preventing closed loop and networking storm. When a fault occurs in a link which is not the ring protection link in the Ethernet ring network, the node which previously blocks the port connected with the ring protection link opens the blocked port, to enable the protected data to pass through the ring protection link so as to establish the communication path over again and improve the network reliability.
FIG. 1 shows a schematic diagram illustrating an Ethernet ring network structure based on the G.8032 standard. As shown in FIG. 1, Node S1, Node S2, Node S3 and Node S4 form the Ethernet ring network. The link between Node S1 and Node S4 is the ring protection link. Node S1 is the node to which the ring protection link belongs and controls to block and open Port 11 so as to block and open the ring protection link. When there is no fault in all links of the Ethernet ring network, Port 11 is blocked by Node S1 to prevent the protected data from passing through the ring protection link, and at the moment, the protected data flow communication path between Node S2 and S3 is S2<->S3 only and cannot be S2<->S1<->S4<->S3.
FIG. 2 shows a structural schematic diagram illustrating the Ethernet ring network as shown in FIG. 1 after a fault occurs in a link. As shown in FIG. 2, provided that a link failure is detected by Node S2 and Node S3, then Node S2 and Node S3 respectively block Port 22 and Port 31 connected with the link where a fault occurs and send a link failure alarm protocol frame to notify other nodes to perform protection switching. After receiving the link failure alarm protocol frame, Node S1, to which the ring protection link belongs, opens the blocked Port 11 which is connected with the ring protection link. An address forwarding table is refreshed by each node on the Ethernet ring network to realize network protection switching. The protected data can pass through the opened ring protection link, and at the moment the communication path of the protected data between Node S2 and Node S3 is S2<->S1<->S4<->S3. Here, the link failure is only one of the situations which cause the protection switching, during actual applications, other situations such as manual switching and forced switching etc. may be further included.
In the Ethernet ring network, the time required by the switching process needs to be learned when the protection switching is performed so as to evaluate the protection performance of the Ethernet ring network system, the service influence and so on. During the communication process, data packets are transmitted and received at a constant speed in the Ethernet ring network. When switching is not performed in the Ethernet ring network, a transmitted packet count should be equal to a received packet count on the same node. When switching is performed in the Ethernet ring network, there will be a loss of a data packet flow to some extent.
A traditional method for measuring the switching time comprises that: the received packet count is deducted from the transmitted packet count of the same node to obtain a lost packet count during the switching process, and then the lost packet count is divided by a packet transmission speed or a packet receiving speed to obtain the switching time. However, during actual applications of the Ethernet ring network, both the data transmission and receiving speed and path are not constant. Therefore, there is a relatively significant difference between the measured switching time and the actual switching time. This measuring method is only an ideal measuring means, which cannot be applied to the actual Ethernet ring network.
Another method for measuring the switching time comprises that: the switching time is calculated via the start and end moments recoded by a node, i.e. in the Ethernet ring network structure, each node calculates its own switching time independently and operates an independent state machine. Since the time among all nodes is not synchronized and the time difference among all the nodes is unknown, or the error of the difference is larger than 50 ms, the switching time of the whole Ethernet ring network cannot be obtained from the switching time of each node. Or if all nodes are synchronized, the time precision is low because the time synchronization operation among all nodes is configured manually, e.g. the time can only be accurate to seconds, which is hard to meet the requirement of the measurement precision, thus bringing great difficulty in measuring the switching time of the Ethernet ring network.